package com.erp.order.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.order.api.domain.ErpSellerOrder;
import com.erp.order.domain.dto.ErpOrderReturnLogisticsPrice;
import com.erp.order.domain.vo.ErpOrderLeftEndGoodTime;
import com.erp.order.domain.vo.ErpSellerOrderSelVo;
import com.erp.order.domain.vo.ErpSellerOrderVo;
import com.erp.order.domain.vo.SearchEvaOrderVo;
import com.erp.order.param.QueryOrderParam;
import com.ruoyi.common.core.annotation.DataColumn;
import com.ruoyi.common.core.annotation.DataPermission;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 卖家订单Mapper接口
 *
 * @author erp
 * @date 2023-03-08
 */
public interface ErpSellerOrderMapper extends BaseMapperPlus<ErpSellerOrderMapper, ErpSellerOrder, ErpSellerOrderVo> {
    
    
    Integer getStatementOrder(@Param("bo") QueryOrderParam bo);

    ErpSellerOrder queryOrderAndProduct(@Param("orderId") Long orderId);

    List<String> getHandoverOrderStoreList();

    List<ErpSellerOrder> selectListByInnerOrderStatus(@Param("innerOrderStatus") List<String> innerOrderStatus);

    List<ErpSellerOrder> getStatics();

    ErpSellerOrder queryOrderByOrderId(@Param("orderId") Long orderId);

    List<ErpOrderReturnLogisticsPrice> getWillReturnLogisticsCharges();

    List<ErpSellerOrder> getBehindErpPayOrderList(@Param("storeList") List<String> storeList);

    List<ErpSellerOrder> selectAddressErrorList();

    SearchEvaOrderVo getSearchEvaOrder(@Param("orderId") Long orderId);

    List<ErpSellerOrder> processOfflineOrder();

    List<ErpSellerOrder> processBeSelfOrder();

    List<ErpSellerOrder> processInvalidOrder();

    /**
     * 根据店铺查询店铺数据 TODO 迁移被临时注释
     */
//    StoreStatisticalDataVo getDataByStoreUserName(@Param("storeUserName") String storeUserName);

    List<ErpOrderLeftEndGoodTime> findOrderLeftEndGoodTime();

    @DataPermission({
            @DataColumn(key = "userName", value = "e.user_id")
    })
    Page<ErpSellerOrder> getSupplementOrder(@Param("page") Page page, @Param("param") QueryOrderParam param);

    List<ErpSellerOrder> findOrderFeeRate();

    List<ErpSellerOrder> findIssueOrder();

    List<ErpSellerOrder> createOrderExtend();

    @DataPermission({
            @DataColumn(key = "userName", value = "e.user_id")
    })
    Page<ErpSellerOrderSelVo> selectOrderSelVoList(@Param("page") Page<ErpSellerOrder> page, @Param("param") QueryOrderParam param);

    List<ErpSellerOrder> queryOrderByOrderIds(@Param("orderIdsList") List<String> orderIdsList);
    
    // TODO 迁移被临时注释
//    List<ErpQueryOrderPriceAdjustInfoDto> queryOrderPriceAdjustInfoByProductId(@Param("aeProductId") Long aeProductId, @Param("type") Integer type, @Param("payTime") String payTime);

    String queryOrderAverageLossByProductId(@Param("aeProductId") Long aeProductId, @Param("days") String days);

    List<Long> queryDuplicateOrders();

    List<Long> queryDuplicateAddressOrders();
}
